home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / debug / memory < prev    next >
Encoding:
Text File  |  1992-12-17  |  3.5 KB  |  71 lines

  1.  
  2.  
  3.           memory options
  4.                The Tcl memory command gives the Tcl developer control
  5.                of Tcl's memory debugging capabilities.  The memory
  6.                command has several suboptions, which are described
  7.                below.  It is only available when Tcl has been compiled
  8.                with memory debugging enabled.
  9.  
  10.           memory info
  11.                Produces a report containing the total allocations and
  12.                frees since Tcl began, the current packets allocated
  13.                (the current number of calls to ckalloc not met by a
  14.                corresponding call to ckfree), the current bytes
  15.                allocated, and the maximum number of packets and bytes
  16.                allocated.
  17.  
  18.           memory trace [on|off]
  19.                Turns memory tracing on or off.  When memory tracing is
  20.                on, every call to ckalloc causes a line of trace
  21.                information to be written to stderr, consisting of the
  22.                word ckalloc, followed by the address returned, the
  23.                amount of memory allocated, and the C filename and line
  24.                number of the code performing the allocation, for
  25.                example...
  26.  
  27.                   ckalloc 40e478 98 tclProc.c 1406
  28.  
  29.                Calls to ckfree are traced in the same manner, except
  30.                that the word ckalloc is replaced by the word ckfree.
  31.  
  32.           memory validate [on|off]
  33.                Turns memory vaidation on or off.  When memory
  34.                validation is enabled, on every call to ckalloc or
  35.                ckfree, the guard zones are checked for every piece of
  36.                memory currently in existence that was allocated by
  37.                ckalloc.  This has a large performance impact and
  38.                should only be used when overwrite problems are
  39.                strongly suspected.  The advantage of enabling memory
  40.                validation is that a guard zone overwrite can be
  41.                detected on the first call to ckalloc or ckfree after
  42.                the overwrite occurred, rather than when the specific
  43.                memory with the overwritten guard zone(s) is freed,
  44.                which may occur long after the overwrite occurred.
  45.  
  46.           memory trace_on_at_malloc nnn
  47.                Enable memory tracing after nnn ckallocs have been
  48.                performed.  For example, if you enter memory
  49.                trace_on_at_malloc 100, after the 100th call to
  50.                ckalloc, memory trace information will begin being
  51.                displayed for all allocations and frees.  Since there
  52.                can be a lot of memory activity before a problem
  53.                occurs, judicious use of this option can reduce the
  54.                slowdown caused by tracing (and the amount of trace
  55.                information produced), if you can identify a number of
  56.                allocations that occur before the problem sets in.  The
  57.                current number of memory allocations that have occured
  58.                since Tcl started is printed on a guard zone failure.
  59.  
  60.           memory break_on_malloc nnn
  61.                After the nnn allocations have been performed, ckallocs
  62.                output a message to this effect and that it is now
  63.                attempting to enter the C debugger.  Tcl will then
  64.                issue a SIGINT signal against itself.  If you are
  65.                running Tcl under a C debugger, it should then enter
  66.                the debugger command mode.
  67.  
  68.           memory display file
  69.                Write a list of all currently allocated memory to the
  70.                specified file.
  71.